package com.hzlj.position.locate.converter;

import com.fz.common.base.converter.ModelDTOConverter;
import com.fz.common.base.core.date.DateUtils;
import com.hzlj.position.locate.common.dto.differentiationData.DifferentiationDataAddDTO;
import com.hzlj.position.locate.common.dto.differentiationData.DifferentiationDataQueryResultDTO;
import com.hzlj.position.locate.common.model.DifferentiationData;

/**
 * 独立业务-数据(DifferentiationData)DTO转换类
 *
 * @author makejava
 * @date 2024-08-16 15:18:45
 */
public class DifferentiationDataConverter {
    /**
     * model实例转换为查询结果DTO
     *
     * @param model model实例
     * @return DTO
     */
    public static DifferentiationDataQueryResultDTO from(DifferentiationData model) {
        return ModelDTOConverter.from(model, DifferentiationDataQueryResultDTO.class);
    }
    
    /**
     * 新增DTO转换为model实例
     *
     * @param dto 新增DTO
     * @return model实例
     */
    public static DifferentiationData from(DifferentiationDataAddDTO dto) {
        return ModelDTOConverter.from(dto, DifferentiationData.class,(DifferentiationData l) -> {
            l.setCreateTime(DateUtils.now());
        });
        
    }
}
